package nodes

import (
	"gitee.com/zfd81/dbrs/sql"
	"vitess.io/vitess/go/sqltypes"
)

type ShowCharset struct {
	CharacterSetTable sql.Node
}

// NewShowCharset returns a new ShowCharset reference.
func NewShowCharset() *ShowCharset {
	return &ShowCharset{}
}

// Resolved implements sql.Node interface. The function always returns true.
func (sc *ShowCharset) Resolved() bool {
	return true
}

func (sc *ShowCharset) String() string {
	return "ShowCharset"
}

// Note how this Schema differs in order from the information_schema.character_sets table.
func (sc *ShowCharset) Schema() sql.Schema {
	return sql.Schema{
		{Name: "Charset", Type: sqltypes.VarChar, Default: sqltypes.NULL, Nullable: false},
		{Name: "Description", Type: sqltypes.VarChar, Default: sqltypes.NULL, Nullable: false},
		{Name: "Default collation", Type: sqltypes.VarChar, Default: sqltypes.NULL, Nullable: false},
		{Name: "Maxlen", Type: sqltypes.Uint8, Default: sqltypes.NULL, Nullable: false},
	}
}
